package com.wgchao.identityrightsmanagement.infrastructure.jpa.repository;

import com.wgchao.identityrightsmanagement.infrastructure.jpa.entity.SysBaseAccount;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface SysBaseAccountRepository extends JpaRepository<SysBaseAccount, Long>, JpaSpecificationExecutor<SysBaseAccount> {

    SysBaseAccount findFirstByUsername(String username);

    SysBaseAccount findFirstByUsernameAndDelFalse(String username);

    List<SysBaseAccount> findAllByAgencyCodeAndDelIsFalse(String agencyCode);

    List<SysBaseAccount> findAllByDepartmentCodeAndDelIsFalse(String departmentCode);

}
